package com.chujian.client.gateway.fallback;

import com.chujian.client.gateway.AuthClient;
import com.chujian.framework.auth.Accessor;
import com.chujian.framework.core.tsdata.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class AuthClientFallback implements FallbackFactory<AuthClient> {
    @Override
    public AuthClient create(Throwable cause) {
        return new AuthClient() {
            @Override
            public Result<Accessor> verifyToken(String uri, String token) {
                log.error("检验token失败token：{}", token);
                return new Result<>();
            }
        };
    }
}
